package org.example.springaop.controller;

import lombok.extern.slf4j.Slf4j;
import org.example.springaop.config.CustomizeAspect;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 九转苍翎
 * Date: 2025/10/23
 * Time: 00:49
 */
@Slf4j
@RestController
@RequestMapping("/demo")
public class Controller {

    @RequestMapping("/a")
    public Object methodA(Integer id){
        log.info("执行methodA");
        return id;
    }

    @RequestMapping("/b")
    public void methodB(){
        log.info("执行methodB");
        throw new RuntimeException("发生异常");
    }

    @RequestMapping("/c")
    @CustomizeAspect
    public Object methodC(Integer id){
        log.info("执行methodC");
        return id;
    }
}
